import 'package:get/get.dart';
import 'package:honeypotflutter/net/public_http.dart';
import 'bussine_express_model.dart';

class ExpressLogic extends GetxController {
  List<MGExpressModel> expressList = [];
  List<MGExpressModel> expressUserList = [];

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    requestExpressList();
    requestUserExpressList();
  }

  /*
  * 请求快递列表
  * */
  requestExpressList() async {
    List list = await MGHttp.get("api/services/app/CourierCompany/GetAllList");
    expressList = list.map((e) => MGExpressModel.fromJson(e)).toList();
  }

  /*
  * 请求快递列表
  * */
  requestUserExpressList() async {
    List list = await MGHttp.get("api/services/app/Account/GetUserCourierCompanySetting");
    expressUserList = list.map((e) => MGExpressModel.fromJson(e)).toList();
  }
}
